Edge-computing-oriented construction method for container mirror image

ABSTRACT

The present invention relates to an edge-computing-oriented construction method for a container image, and the construction method for a container image at least comprising steps of: having an image reconstruction module reconstruct an old container image so as to obtain a new container image comprising an index and a set of spare files that correspond to each other, and having an image management module store the index and the spare files separately from each other in an image repository and a spare file storage module respectively; having a download engine module scrape the index from the image repository to a corresponding container in the edge end, so that a container instance service module conducts search in a local file sharing module according to configuration information contained in the index and thereby retrieves a local shared file corresponding to the configuration information, an image file consulting module is configured to download a default file from the spare file storage module that does not exist in the local shared file retrieved according to the configuration information, and a service processor uploads the local shared file and the default file recorded according to the configuration information to the image reconstruction module, so that to match and to generate the index.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of the Chinese Patent ApplicationNo. 202010013040.5 filed on Jan. 9, 2020, which is incorporated byreference as herein in its entirety.

BACKGROUND OF THE INVENTION 1. Technical Field

The present invention relates to computer application systems, and moreparticularly to an edge-computing-oriented construction method for acontainer image.

2. Description of Related Art

The container technology has become the norm for deployment ofapplications in cloud environments because of its fast initiation, lowerresources overheads and lightweight resource isolation. Container as alightweight technology is also more and more popular in edge computing.However, due to the fact that broadband networks in edge computing aresmaller than those in cloud environments, the conventional method forconstructing container images traditionally used in clouds is notsuitable for edge computing scenarios because it is demanding in termsof bandwidth.

For example, China Patent Publication No. CN108399094A discloses adeployment method for applications, its deployment devices and it edgedata center. The known method combines two virtualization technologies,virtual machine and container, to implement deployment for applicationsof different security levels. For an application with a high securitylevel, its deployment is performed by activating the container in avirtual machine, and for an application with a low security level, itsdeployment is performed by activating the container in a physicalmachine. This approach advantageously combines safe isolation of avirtual machine and lightweight, fast deployment of a container, so asto get the best from the two schemes, thereby ensuring safe isolationfor applications of different security levels.

Container images form a basis for activation of container instanceservices and contain all the data required by containers. Beforeactivation of container instance services, complete container imageshave to be downloaded locally. A common Docker container frameworkimplements a client-repository model. Therein, a client end manages theactual lifecycle of a container, including activation, pause,restoration and destruction. The repository end serves to centrallystore container images to be deployed for the client end to acquire therequired images freely.

Docker container images have a layered architecture. In other words, acontainer image is composed of multiple image layers, and each imagelayer stores a part of image data. When there is a need for a containerinstance service, all image layers are union mounted to one directory bemeans of a union file system, so as to provide the container instancewith a complete view of the file system, thereby enabling the containerto operate normally. The layered architecture is advantageous becausewhen there is an identical image layer existing at local images, theimage layer is not downloaded repeatedly. Instead, it is shared amongthe images. This not only reduces required the network and storageresources, but also speed up deployment of container instance services.

However, where preparing container images, a user often introduces muchnecessary data, making the image much greater than what is really needin terms of data size. Additionally, such a layered architecture tendsto suffer from ineffective sharing because of its large sharinggranularity. Therefore, such a layered architecture requires the entireimage to be downloaded in the format of the local image before itsactivation, making it less efficient in practical use. This hinders thecontainer technology from working in edge computing scenarios. Hence,there is a need for an edge-computing-oriented construction method forcontainer images.

Since there is certainly discrepancy between the prior art comprehendedby the applicant of this patent application and that known by the patentexaminers and since there are many details and disclosures disclosed inliteratures and patent documents that have been referred by theapplicant during creation of the present invention not exhaustivelyrecited here, it is to be noted that the present invention shallactually include technical features of all of these prior-art works, andthe applicant reserves the right to supplement the application with therelated art more existing technical features as support according torelevant regulations.

SUMMARY OF THE INVENTION

As a solution to the foregoing problems, the present invention providesan edge-computing-oriented construction method for a container image,wherein the construction method for a container image at leastcomprising steps of: in a cloud, having an image reconstruction modulereconstruct an old layered container image so as to obtain a newcontainer image comprising an index and a set of spare files thatcorrespond to each other, and having an image management module storethe index and the spare files separately from each other in an imagerepository and a spare file storage module, respectively; in an edgeend, during first-time deployment, having a download engine modulescrape the index from the image repository to a corresponding containerin the edge end, so that a container instance service module conductssearch in a local file sharing module according to configurationinformation contained in the index and thereby retrieves a local sharedfile corresponding to the configuration information, and an image fileconsulting module is configured to download a default file from thespare file storage module that does not exist in the local shared fileretrieved according to the configuration information, and a serviceprocessor uploads the local shared file and the default file recordedaccording to the configuration information to the image reconstructionmodule, so that the image reconstruction module is enabled to match theaccess file with the configuration information to generate the index.

According to one preferred embodiment, linking the default file and thelocal shared file to a private directory storage module of thecontainer, so as to provide a root directory mount point for thecontainer instance service module; when the container instance servicemodule requests for a target file, having the private directory storagemodule request for a Hash value corresponding to the target file in theindex according to the target file; and having the private directorystorage module check whether there is a target file named after the Hashvalue in a private directory of the index, and if yes, loading thetarget file to the container instance service module; or if no, havingthe private directory storage module check whether there is the targetfile named after the Hash value in the local file sharing module, and ifyes, linking the target file to the private directory of the index forthe container instance service module to load; or if no, having theimage file consulting module download the target file from the sparefile storage module to the local file sharing module for the containerinstance service module to load.

According to one preferred embodiment, the image reconstruction modulereconstructs the old image into the new image through reconstructionsub-steps of: performing union mount for the old image, and acquiringits complete file information; traversing the file information, andextracting contents of all regular files in the complete file system fortheir hash values, generating the spare files by means of extracting thecontents of the regular files with the Hash value, and using the filesystem after replacement as the index; acquiring configurationinformation of the old image, wherein the configuration information atleast includes environment variables, exposed ports numbers and volumesinformation and is used to construct the index; and using a servicefunction of the server to upload accessed file information generatedduring service processing and the acquired configuration information tothe image reconstruction module to construct the index.

According to one preferred embodiment, the service processor updates theindex by means of: before performing service based on the configurationinformation, determining whether the configuration information isreferred to for the first time; and if the index is not referred to forthe first time, having the container instance service module activatethe container without updating the index by means of requesting for thetarget file based on the index, thereby loading the target file from aprivate file in the private directory storage module of the index; or ifthe index is referred to for the first time, having the containerinstance service module activate the container after the imagereconstruction module updates the index by means of requesting for thetarget file based on the index, thereby loading the target file from aprivate file in the private directory storage module of the index.

According to one preferred embodiment, in the cloud, when the imagereconstruction module requests to upload the spare files, having the newimage management module search for spare files already existing in thespare file storage module, so as to enable it to transmit the sparefiles that do not exist in the spare file storage module to the sparefile storage module without repeatedly uploading the already existingspare files.

According to one preferred embodiment, the service processor sends thedefault file and the accessed local shared file to the imagereconstruction module, and the image reconstruction module matches thedefault file and the accessed local shared file with the configurationinformation so as to update the index before the image management modulestores the index into the image repository.

According to one preferred embodiment, the present invention furtherdiscloses an edge-computing-oriented construction system for a containerimage, so as to execute the above construction method.

The present invention provides an edge-computing-oriented constructionmethod for container images and a system using the same, which at leasthas the following advantages:

(1) the present invention uses an on-demand acquisition method toeffectively enhance deployment efficiency of containers and reduce useof network resources and of client storage resources while keeping thenew images transparent to users;

(2) by caching data locally, the present invention allows local sharingwhen different containers require for the same data, thereby furtherreducing use of network/storage resources, and allows containerapplications to access local data directly, thereby ensuring I/Operformance of the container applications; and

(3) the present invention refines sharing from layer-level sharing tofile-level sharing, because sharing of fine granularity significantlyreduces use of storage resources of the image repository.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a module structure of an edge-computing-oriented containerimage construction system according to the present invention;

FIG. 2 shows an image construction module of the edge-computing-orientedcontainer image construction system of the present invention;

FIG. 3 illustrates a reconstruction method for a container image fileaccording to the present invention;

FIG. 4 is a detailed flowchart of reconstruction of an image and storageof a new image according to the present invention;

FIG. 5 is a detailed flowchart of deployment of the new image accordingto the present invention; and

FIG. 6 is a detailed flowchart of on-demand acquisition of image dataaccording to the present invention.

DETAILED DESCRIPTION OF THE INVENTION

The invention as well as a preferred mode of use, further objectives andadvantages thereof will be best understood by reference to the followingdetailed description of illustrative embodiments when read inconjunction with the accompanying drawings, FIGS. 1 through 6.

For clarity, some technical terms used in this document are defined asbelow.

A container is an open-source engine, capable of packing software intostandardized unit for use in development, interaction and deployment.

A container instance service (CIS) is an ideal execution load. With animage of a container of a program, the program can be run using somesimple configurations and very low costs. Such as running programverification, scraping a website, deploying one Web service and so on,any container-enabled simple application can be deployed using CIS.

DockerHub is used for source code management and integration, and isalso used to construct and test tools for reducing deployment cyclesfrom days to minutes.

An image drive stores information related to container images, and usesthe information and drive types of file systems (e.g. AUFS, OVERLAY, orOVERLAY2) to organize and manage data of affected layers.

An index is a separate physical object within a relational database. Itstores a sorted list of values from one or a combination of fields withpointers to individual data records that contain those values.

Embodiment 1

The present embodiment discloses an edge-computing-oriented containerimage construction system. As shown in FIG. 1, the containerconstruction system comprises a cloud 100 and an edge end. The cloud 100and the edge end are capable of information interaction. As shown inFIG. 2, the edge end includes containers 200, an image file consultingmodule 200 e, and a local file sharing module 200 f. The container 200includes a download engine module 200 a, a service processor 200 d, aprivate directory storage module 200 c and a container instance servicemodule 200 b. As shown in FIG. 1, the cloud 100 at least comprises animage repository 100 d, an image reconstruction module 100 b, an imagemonitoring module 100 c, an image management module 100 a and a sparefile storage module 10 e.

As shown in FIG. 1 and FIG. 3, the image reconstruction module 100 breconstructs the old container image into a new container imageincluding an index and a set of spare files. The index and the sparefiles correspond to each other. The index is stored into the imagerepository 100 d by the image management module 100 a, for thecorresponding container 200 in the edge end to download. The spare filesare stored into the spare file storage module 100 e by the imagemanagement module 100 a, for on-demand download by the edge end.Preferably, the old container image may be a container image originallyin the image repository 100 d, or may be a newly added container image.For reconstructing the newly added container image, the cloud 100 isprovided with an image monitoring module 100 c, for monitoring anddetermining whether there is a newly added container image in the imagerepository 100 d. If there is a newly added container image in themonitored image repository 100 d, the image monitoring module 100 ctransmits the newly added container image to the image reconstructionmodule 100 b for reconstruction. The index includes two parts: theconfiguration information and the file information with the regular filecontent extracted out.

During first-time deployment, the index is downloaded. The containerinstance service has to be activated according to the configurationinformation in the index, and it then search for and loads a fileaccording to the Hash value of a regular file in the index. Since thisis the first-time operation, all the files required by the containerinstance service have to be downloaded one by one according to theindex. This is a time-consuming process because the file is transmittedthrough the network. Therefore, during first-time deployment, the filesused by the container instance service are recorded, and this record isuploaded to the image reconstruction module where it is packed into theindex. This process is known as updating. During subsequent deployment,since the downloaded index contains this record, the files required bythe container can be all downloaded locally at one time before thecontainer is activated, so as to accelerate container deployment.

As shown in FIG. 1 and FIG. 2, the download engine module 200 a scrapesthe index from the image repository 100 d to the corresponding container200 in the edge end. The container instance service module 200 bsearches a local shared file corresponding to the configurationinformation acquired from the local file sharing module 200 f based onthe configuration information in the index. In addition, the image fileconsulting module 200 e can download the default file that does notexist in the local shared file as needed using the configurationinformation from the spare file storage module 100 e. The serviceprocessor 200 d sends the default file and the accessed local sharedfile to the image reconstruction module 100 b. The image reconstructionmodule 100 b matches the default file and the accessed local shared filewith the configuration information so as to update the index. The imagemanagement module 100 a stores the index to the image repository.

Preferably, private directory storage module 200 c in the container 200that has performed service on the old image in the edge end stores thedefault file and the local shared file. Thereby, the private directorystorage module 200 c provides the new image with a root directory mountpoint. Further, the container instance service module 200 b can performthe container instance service simply by reading the index form theimage repository in the cloud 100.

Preferably, the container instance service at least comprises thefollowing steps. When the container instance service module 200 brequests for a target file, the private directory storage module 200 creads the Hash value corresponding to the target file in the index. Theprivate directory storage module 200 c checks in the private directoryof the index whether there is a target file named after the Hash value.If yes, the target file is loaded to the container instance servicemodule 200 b. Otherwise, the private directory storage module 200 cchecks whether there is a target file named after the Hash value in thelocal file sharing module 200 f. If yes, the target file is linked tothe private directory of the index for the container instance servicemodule 200 b to load. Otherwise, the image file consulting module 200 edownloads the target file from the spare file storage module 100 e tothe local file sharing module 200 f for the container instance servicemodule 200 b to load. In this way, during the container instanceservice, the corresponding target file can be downloaded in the edge endas much as possible based on the index, so as to decrease communicationoverheads between the cloud and the edge end.

Preferably, image reconstruction module 100 b reconstructs old the imageinto the new image at least through the following reconstructionsub-steps: performing union mount on the old image, acquiring itscomplete file information; traversing the file information, extractingthe contents of all the regular files for Hash operation, and using theHash value to replace the content of the regular files so as to generatespare files and index image. The image reconstruction includes:performing union mount on the old image, and acquiring its complete filesystem. The file system is traversed to have the content of all theregular files extracted and stored as the spare files. The content ofthe regular files in the file system is replaced by Hash values. Allconfiguration information of the old image is acquired, includingenvironment variables, exposed port number, volume information. With theconstruction capability of the container engine, a new image isconstructed from the processed file system and all the acquiredconfiguration information, and this image is a single-layer image. Thisimage is an index image, as shown in FIG. 3.

Embodiment 2

The present embodiment provides further improvements and/or supplementsto Embodiment 1, and what is identical to its counterpart in theprevious embodiment will not be repeated in the following description.Without causing conflict or contradiction, the entire and/or part ofpreferred modes of other embodiments may be incorporated into thepresent embodiment as supplements.

According to the present invention, reconstruction of Docker imagesprimarily comprises the following steps:

1.1 performing union mount on layered Docker images;

1.2 traversing individual files in a root directory of the Dockerimages, and if the current file is a regular file, performing Hashoperation on its content, using the Hash value so obtained to replacethe file content, compressing the file content using gzip, naming theresulting file after the Hash value and using it as a set of sparefiles, wherein a file that is not a regular file is not changed andremains its architecture as a file system root directory;

1.3 packing the image root directory after the foregoing replacement;extracting a series of attributes of the Docker images, includinginformation on environment variables, tags, the volume, the workingdirectory, and the exposed ports; according to the information of theboth, constructing a Docker file of the index and constructing an indexof the new image with the assistance of the Docker constructionfunction; and

1.4 pushing the new image index to the image repository and storing thespare files to the dedicated file storage system.

The overall architecture of the present invention is composed of twoparts: a cloud 100 and a container 200. The cloud 100 primarilycomprises three modules: an image monitoring module 100 c, an imagereconstruction module 100 b and a new image management module 100 a. Theimage monitoring module 100 c serves to monitor the Docker imagerepository, and to submit the image information not reconstructed yet(i.e. the old image) to the image reconstruction module 100 b. The imagereconstruction module 100 b reconstructs each Docker container imageinto a new image format: index file and spare files. Each spare file isstored in a compressed format, such as gzip, thereby reducing itsstorage occupation. The new image management module 100 a serves to pushthe index file to the image repository 100 d, and to store the sparefiles in the spare file storage module 100 e. The edge end primarilycomprises two modules: an image storage driver and an image file system.The image storage driver is developed as a plug-in, so that it can beeasily installed and used. The image storage driver serves to storelocally in a certain manner the container image data downloaded by theDocker engine, and serves to provide the root directory mount point forthe container instance service during activation of the image storagedriver. The image file system serves to perform union mount between theindex of the new image and the spare files, and to show the completeview of the complete container root directory at the mount point of thecontainer instance service root directory, so as to enable the containerto read data normally and accurately.

Reconstruction of the Docker image and storage of the new image areprimarily achieved through the following steps:

S1: activating the image monitoring module;

S2: having the image monitoring module 100 c monitor the imagerepository 100 d, wherein the image registry contains the image notreconstructed yet (i.e. the old container image) and the newly pushedimage (i.e. the new container image);

S3: in the cloud 100, the image monitoring module 100 c continuouslymonitoring the image repository 100 d until the image monitoring module100 c recognizes the old container image from the image repository 100 dwhen the image reconstruction module 100 b is to be activated;

S4: once the image monitoring module 100 c finds that there is an imagenot reconstructed yet in the image repository 100 d, sending the imagenot reconstructed yet to the image reconstruction module 100 b;

S5: having the image reconstruction module 100 b download the image notreconstructed yet locally according to the obtained information, so asto prepare for reconstruction of the image;

S6: sending the reconstructed index and the spare files to the new imagemanagement module,

S7: having the new image management module 100 a push the index to theimage repository;

S8: uploading the spare files to the file storage system.

S9-S11: preferably, in the cloud 100, having the new image managementmodule 100 a search for spare files existing in the spare file storagemodule 100 e when the image reconstruction module 100 b requests toupload spare files, so that the spare files not existing in the sparefile storage module 100 e are uploaded to the spare file storage module100 e with the spare files already existing not uploaded again, wherein,in the process of uploading the spare files, the file system isconsulted so that only the files not uploaded yet are uploaded and nofiles are repeatedly uploaded.

Preferably, the service processor 200 d constructs the index asdescribed previously. Before the service is provided based on theconfiguration information, it is determined whether the configurationinformation is referred to for the first time. If the index is notreferred to for the first time, the container instance service module200 b activates the container 200 without updating the index by means ofrequesting for the target file based on the index, thereby loading thetarget file from a private file in the private directory storage module200 c of the index. If the index is referred to for the first time, thecontainer instance service module 200 b activates the container 200after the image reconstruction module 100 b updates the index by meansof requesting for the target file based on the index, thereby loadingthe target file from a private file in the private directory storagemodule 200 c of the index. For example, this comprises:

F1: having the Docker engine pull the container image from the imagerepository to local and send the acquired data to the image storagedriver;

F2: having the storage driver determine whether the image data to bestored locally is a Docker image or the index of a new image, and if itis a Docker container image, moving to steps F4, or otherwise, moving tosteps F30;

F4: having the storage driver retrogress to the storage driver for theDocker container, storing the image data according to the Dockerstandard, using the file system as default in Docker to mount thecontainer instance service root directory mount point, and moving toEND;

F30: having the storage driver store the image data locally, and usingthe new image file system to perform union mount between the index andthe spare files, thereby providing the container instance service withthe root directory mount point;

F31: activating a new image container;

F5: determining whether it is the firs-time activation of the new image,if yes, proceeding with Step F60, or if no, proceeding with Step F70;

F60: recording all the files accessed by the container during itsservice,

F61: submitting the information to the image reconstruction module,wherein the service of the container is essentially reading files, andrunning files is done based on the index, with the search conducted inthe order of the private directory and then the shared directory, inwhich if the result is found in the private directory, the file contentis directly read and returned, or if the result is found in the shareddirectory, the result is first hard-linked to the private directory, andthen returned from the private directory, or if the result is found inneither the private directory nor the shared directory, the result isacquired from a remote file server, stored into the shared directory,hard-linked to the private directory, and then returned from the privatedirectory;

F62: having the image reconstruction module update the new image indexaccording to the obtained file record information by adding the filerecord information to the new image index, and moving to END;

F70: having the storage driver check for the local shared directory fora file not existing locally according to the file record information;

F71: having the storage driver download the file not existing locallyfrom the remote spare file storage system to the local shared directory;

F72: hard-linking all the files in the shared directory required by thecontainer to the private directory of the new image; and

END: ending/moving to reading the container data.

On-demand acquisition of the image data primarily comprises thefollowing steps:

P1: having the new image container instance service request for a file;

P2: having the new image file system acquire the Hash value of the filein the new image index according to the file request;

P3: having the new image file system checking whether there is a filenamed after the Hash value in the private directory of the new image, ifno, moving to P4, or otherwise, moving to P8;

P4: having the new image file system checking the local shareddirectory;

P5: determining whether there is a file named after the Hash value inthe local shared directory, if no, moving to P6, or otherwise, moving toP7;

P6: downloading the target file form the remote spare file storagesystem to the local shared directory;

P7: linking the target file to the private directory of the new image bymeans of a hard link; and

P8: returning the target file to the container instance service.

As used herein, the term “module” may refer to any kind of hardware,software or a combination of thereof, which is able to execute functionsassociated with the “module”.

It should be noted that the above specific embodiments are exemplary,persons skilled in the art can devise various solutions under theinspiration of the disclosed content of the present invention, and thesolutions also belong to the disclosed scope of the present inventionand fall into the protection scope of the present invention. Personsskilled in the art shall understand that the specification and itsdrawings of the present invention are exemplary and do not limit theclaims. The protection scope of the present invention is limited by theclaims and its equivalents.

What is claimed is:
 1. An edge-computing-oriented construction methodfor a container image, wherein the edge-computing-oriented constructionmethod for a container image comprises steps of: reconstructing, by animage reconstruction module executed on a computer system in a cloud, anold container image so as to obtain a new container image comprising anindex and a set of spare files that correspond to each other, whereinthe reconstructing the old container image into the new container imageincludes performing union mount for the old container image, andgenerating the spare files by replacing content of regular files with aHash value: storing, by an image management module executed on acomputer system in the cloud, the index and the spare files separatelyfrom each other in an image repository and a spare file storage module,respectively; and in an edge end, during first-time deployment:scraping, by a download engine module executed on a computer system, theindex from the image repository to a corresponding container in the edgeend, so that a container instance service module conducts a search in alocal the sharing module according to configuration information of theold container image contained in the index and thereby retrieves a localshared file corresponding to the configuration information, wherein theconfiguration information includes environment variables, exposed portnumbers and volume information; downloading, by an image the consultingmodule executed on a computer system, a default file from the spare filestorage module that does not exist in the local shared the retrievedaccording to the configuration information; uploading, by a serviceprocessor via a network, the local shared file and recording the defaultfile according to the configuration information to the imagereconstruction module, so that the image reconstruction module isenabled to match the default the and the local shared the with theconfiguration information to update the index; linking the recordeddefault file and the uploaded local shared file to a private directorystorage module of the container, so as to provide the new containedimage with a root directory mount point for the container instanceservice module; when the container instance service module requests fora target file, requesting, by the private directory storage moduleexecuted on a computer system, the Hash value corresponding to thetarget the in the index according to the target file, and checkingwhether there is a target file named in a private directory of the indexafter reading the Hash value in a private directory of the index; whenthe target file named to the container instance service module afterreading the Hash value in the private directory index; when the targetfile named is not in the private directory of the index, checking, bythe private directory storage module whether there is the target filenamed in the local file sharing module after reading the Hash value inthe local the sharing module, when the target the named is in the localfile sharing module, linking the target file named to the privatedirectory of the index for the container instance service module to loadthe target file from a private file into the private directory storagemodule of the index after reading the Hash value; when the target thenamed is not in the local file sharing module, downloading, by the imagefile consulting module executed on a computer system, the target filenamed from the spare file storage module to the local the sharing modulefor the container instance service module to load the target the fromthe private file into the private directory storage module of the index;and activating in the cloud by the image reconstruction module inresponse to an image monitoring module recognizing the old containerimage in the image repository.
 2. The construction method of claim 1,wherein the image reconstruction module further reconstructs the oldcontainer image into the new container image through reconstructionsub-steps of: acquiring the old container image's complete fileinformation; traversing the complete file information and extractingcontent of a regular file in the complete file information for Hashoperation; acquiring configuration information of the old containerimage, wherein the configuration information is used to construct theindex; and using a service function of a server to upload accessed fileinformation generated during service processing and the acquiredconfiguration information to the image reconstruction module toconstruct the index.
 3. The construction method of claim 2, wherein theservice processor updates the index before performing service based onthe configuration information, determining whether the configurationinformation is referred to for first time; and if the index is notreferred to for the first time, having the container instance servicemodule activate the container without updating the index by requestingfor the target the based on the index, thereby loading the target thefrom a private the into the private directory storage module of theindex; or if the index is referred to for the first time, having thecontainer instance service module activate the container after the imagereconstruction module updates the index by requesting for the target thebased on the index, thereby loading the target file from a private fileinto the private directory storage module of the index.
 4. Theconstruction method of claim 3, comprising: in the cloud, when the imagereconstruction module requests to upload the spare files, having newimage management module search for spare files already existing in thespare file storage module, so as to enable the new image managementmodule to transmit the spare files that do not exist in the spare thestorage module to the spare file storage module without repeatedlyuploading the already existing spare files.
 5. The construction methodof claim 4, wherein the service processor sends the default file and thelocal shared file to the image reconstruction module, and the imagereconstruction module matches the default the and the local shared filewith the configuration information so as to update the index before theimage management module stores the index into the image repository. 6.An edge-computing-oriented construction system for a container image,comprising: a network; a cloud and an edge end that communicate witheach other via the network, wherein in the cloud, an imagereconstruction module configured to reconstruct an old container imageso as to obtain a new container image comprising an index, wherein thereconstructing the old container image into the new container imageincludes performing union mount for the old container image, andgenerating the spare files by replacing content of regular files with aHash value; and in the cloud, an image management module configured tostore the index and the spare files separately from each other in animage repository and a spare file storage module, respectively; and inan edge end, during first-time deployment: a download engine moduleconfigured to scrape the index from the image repository to acorresponding container in the edge end, so that a container instanceservice module is configured to conduct a search in a local file sharingmodule according to configuration information of the old container imagecontained in the index and thereby retrieves a local shared filecorresponding to the configuration information, wherein theconfiguration information includes environment variables, exposed portnumbers and volume information; an image file consulting moduleconfigured to download a default the from the spare file storage modulethat does not exist in the local shared file retrieved according to theconfiguration information; a service processor configured to upload thelocal shared the and record the default the according to theconfiguration information to the image reconstruction module, so thatthe image reconstruction module is enabled to match the default the andthe local shared the with the configuration information to update theindex; the image reconstruction module linking the recorded default fileand the uploaded local shared the to a private directory storage moduleof the container, so as to provide the new container image with a rootdirectory mount point for the container instance service module; whenthe container instance service module requests for a target file, havingthe private directory storage module request for a the Hash valuecorresponding to the target file in the index according to the targetfile, and having the private directory storage module check whetherthere is a target file named in a private directory of the index afterreading the Hash value in a private directory of the index; when thetarget file named is in the private directory of the index, loading thetarget the named in the private directory of the index to the containerinstance service module after reading the Hash value in the privatedirectory of the index; when the target file named is not in the privatedirectory of the index, having the private directory storage modulecheck whether there is the target file named in the local file sharingmodule; when the target file named is in the local file sharing module,linking the target file named to the private directory of the index forthe container instance service module to load the target file from aprivate file into the private directory storage module of the index;when the target file named is not in the local file sharing module,having the image the consulting module download the target file namedfrom the spare file storage module to the local file sharing module forthe container instance service module to load the target the from aprivate file into the private directory storage module of the index; andwherein in the cloud, the image reconstruction module is configured tobe activated in response to an image monitoring module recognizing theold container image in the image repository.
 7. The construction systemof claim 6, wherein the image reconstruction module further reconstructsthe old container image into the new container image throughreconstruction sub-steps of: acquiring the old container image'scomplete the information; traversing the information, and extractingcontent of a regular file in the complete file information for Hashoperation; using the regular file after replacement as the index;acquiring configuration information of the old container image, whereinthe configuration information is used to construct the index; and usinga service function of the server to upload accessed the informationgenerated during service processing and the acquired configurationinformation to the image reconstruction module to update the index.